/**
 * 
 */
var myBusyIndicator = new WL.BusyIndicator('main',{text : "waiting..."});

/**
 * initialize the event list
 */
(function($){
	$(document).bind("pageshow", function() {
		WL.Logger.info("eventlist page begin");
		getEventlistSuccess({});
	});
})(jQuery);

/**
 * get history book success, initialize the page according to the result
 */
function getEventlistSuccess(result) {
//	myBusyIndicator.hide();
	WL.Logger.info("getEventlistSuccess");
	var testData = [ {
		'src' : '../images/1.gif',
		'time' : '2012-12-12 12:00',
		'address' : 'shanghaizhangjiang',
		'content' : 'the biggest show in 2012 will hold at the gym',
	}, {
		'src' : '../images/2.gif',
		'time' : '2013-12-12 13:45',
		'address' : 'shanghaizhangjiang',
		'content' : 'the biggest show will hold at the gym',
	}, {
		'src' : '../images/3.gif',
		'time' : '2013-12-12 13:45',
		'address' : 'shanghaizhangjiang',
		'content' : 'the biggest show will hold',
	}, {
		'src' : '../images/4.gif',
		'time' : '2013-12-12 13:45',
		'address' : 'shanghaizhangjiang',
		'content' : 'the biggest show will hold at the gym',
	}];
	
	$.each(testData, function(i, item) {
		var itemContent = "<div class='bookItem'><div style='float:left'><img src='" + item.src + "' width='48px' height='48px'></div>";
		
		itemContent = itemContent.concat("<div style='float:left'><div class='leftCommon boldFont'>");
		
		itemContent = itemContent.concat(item.content);
		itemContent = itemContent.concat("</div></div><p style='clear: both'></p>");
		itemContent = itemContent.concat("<div class='leftCommon'>");
		
		itemContent = itemContent.concat("</div><p style='clear: both'></p>");
		itemContent = itemContent.concat("<div class='leftCommon smallFont grayFont'>" + item.address + "</div>");
		itemContent = itemContent.concat("<div class='leftCommon smallFont grayFont'>" + item.time + "</div>");
		itemContent = itemContent.concat("<p style='clear: both'></p><hr /></div>");
		
		$(itemContent).appendTo($("#eventlist"));
	});
	
}